import http from "@/utils/request"

export default {
    login(data) {
        return http.post('/public/admin/user/login', data)
    },
    register(data) {
        return http.post('/public/admin/user/register', data)
    },
    updateUser(data){
        return http.put('/admin/user', data)
    },
    deleteUser(ids) {
        return http.delete(`/admin/user/delete/${ids}`)
    },
    getUserInfo() {
        return http.get('/admin/user/getUserInfo')
    },
    logout() {
        return http.post('/admin/user/logout')
    },
    getUserList(data) {
        return http.get('/admin/user/page', {params: data})
    },
    /**
     * 创建用户
     * @param data
     * @returns {Promise<axios.AxiosResponse<any>>}
     */
    createUser(data) {
        return http.post('/admin/user', data)
    },
    delUser(data) {
        return http.delete('/admin/user', {params: data})
    },
    editUser(data) {
        return http.put('/admin/user', data)
    },
}

